All Questions
11 questions
2votes
2answers
177views
Finding minimum steps required to traverse from source to terminal
Hello everyone this is my first post here so please do critique my post if there's anything. I have made a program intended to pass a programming challenge on open.kattis.com, here. It should do as ...
3votes
0answers
214views
Codingame: Great Escape bot in Ruby - Follow-up
This is a follow-up to Codingame: Great Escape bot in Ruby. As mentioned there, my first reasonably sized Ruby project is a bot for CodinGame's Great Escape contest (here is a sample gameplay video). ...
2votes
3answers
285views
Project Euler - Smallest multiple (Ruby)
My code is very slow to run, and I am trying to find a way to make it more efficient. I know there must be a better way than to write each modulo operation. The goal of the script is to find the ...
6votes
1answer
165views
Check sum of all primes under two million
I'm exploring ruby by writing a code that checks the sum of all prime numbers under two million. As I am still in the process of learning ruby, I'm unfamiliar with all the standards and best practices....
3votes
1answer
1kviews
Project Euler #10 in Ruby. Three ways to sum primes below 2 million
Question: Add all prime numbers smaller than 2,000,000. The first method is done by deriving own is_prime? method: ...
3votes
2answers
76views
Project Euler #1 in Ruby with duration
I have done #1 of Project Euler's in Ruby. Using two different approaches. One uses set, another uses reduce. ...
0votes
4answers
218views
Finding powers of multiple array pairs
I'm doing a challenge on TalentBuddy that requires you to find the powers of multiple array pairs. Since I got the solution right, but not fast enough, I decided I'd ask for help here. ...
5votes
2answers
3kviews
Reverse Game HackerRank Ruby Solution
Problem Statement Akash and Akhil are playing a game. They have N balls numbered from 0 to N−1. Akhil asks Akash to reverse the position of the balls, i.e., to change the order from ...
3votes
2answers
182views
Building a list - why is this code inefficient?
I'm attempting this code challenge. Here's my code modified to handle one simple example test case: ...
4votes
2answers
2kviews
Performance of Codility MaxCounter challenge solution
I'm doing some of the Codility challenges using Ruby. The current challenge is "The MaxCounter," which is described as: Calculate the values of counters after applying all alternating operations: ...
3votes
3answers
418views
Speed up counting sort algorithm in Ruby
I'm attempting this simple HackerRank counting sort problem but testcase #3, which has 100,000 test cases, is timing out. Is there something particularly inefficient about this code? ...